// NIRMA STUDIO, 2013
// Object INIT
#include <iostream>
#include <math.h>
#include <iomanip>

using namespace std;

class Object {
	public:
		int 	level,crit_chance;
		string 	name;
		float 	attack, health, mana, experience, max_experience;
		float 	hp_regen, mana_regen;
		bool 	alone, rested, aggro_idx, horrified;

		Object();
		~Object();
		void 	stat();
		void 	gain_exp(int x);
		void 	gain_level();
		void 	take_dmg(float dmg);
};

Object::Object(){}

Object::~Object(){}

void Object::stat(){
	cout << endl;
	cout << "Name:      	" << setw(10) << name                   << endl;
	cout << "Level:     	" << setw(10) << level                  << endl;
	cout << "Health:    	" << setw(10) << float(health)          << endl;
	cout << "Mana:      	" << setw(10) << float(mana)            << endl;
	cout << "Attack:    	" << setw(10) << float(attack)          << endl;
	cout << "Experience:    " << setw(11) << float(experience)      << endl;
	cout << "Max Experience:" << setw(11) << float(max_experience)  << endl;
	cout << endl;
}

void Object::gain_exp(int x){
	experience += x;
	if(experience >= max_experience) Object::gain_level();
}

void Object::gain_level(){
	level 			+= 1;
	attack     		= 1.0  * (pow(1.3, level));
	health     		= 10.0 * (pow(1.2, level));
	mana       		= 1.0  * (pow(1.2, level));
	experience 		= 0;
	max_experience  = 10.0 * (pow(1.4, level));
}

void Object::take_dmg(float dmg){
	health -= dmg;
	if(health <= 0) delete this;
}